home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: netcom.com!smryan
- From: smryan@netcom.com (@#$%!?!)
- Subject: Re: Formatted print with variable output field width.
- Message-ID: <smryanDpMqv2.Bv4@netcom.com>
- Organization: The Programmer formerly known as S M Ryan
- X-Newsreader: TIN [version 1.2 PL1]
- References: <berlinerDpMBoE.AEn@netcom.com>
- Date: Wed, 10 Apr 1996 04:52:13 GMT
- Sender: smryan@netcom12.netcom.com
-
- : printf("%<v+3>.<v>f", floatingnum);
-
-
- char s[100];
- sprintf(s,"%%%d.%df",v+3,v);
- printf(s,floatingnum);
-
- Any C function that has a char* argument, such as the first of printf,
- you can use a constant string, a character array, a character pointer,
- a function which returns a character pointer (such as printf(fgets(f),g)),
- or any other expression which is char*.
-
- --
- The Queen, amused, in quiet power, | smryan@netcom.com PO Box 1563
- will draw the son to darkenned bower. | Cupertino, California
- Her face is fair, her fragrance rare, | (xxx)xxx-xxxx 95015
- with woven webs for wayward flower. | I don't use no smileys
-